<?php
declare(strict_types=1);
/**
 * MineAdmin is committed to providing solutions for quickly building web applications
 * Please view the LICENSE file that was distributed with this source code,
 * For the full copyright and license information.
 * Thank you very much for using MineAdmin.
 *
 * @Author X.Mo<root@imoi.cn>
 * @Link   https://gitee.com/xmo/MineAdmin
 */
namespace Plugin\Attractions\Commerce\Request\Commerce_settlement;

use Hyperf\Validation\Request\FormRequest;

/**
 * 商户结算验证数据类
 */
class CommerceSettlementRequest extends FormRequest
{

    public function authorize(): bool
    {
        return true;
    }


    /**
     * 新增数据验证规则
     * return array
     */
    public function rules(): array
    {
        return [
            //结算状态：1-待结算，2-已结算 验证
            'settlement_status' => 'required',
            //结算日期 验证
            'settlement_date' => 'required',
            //付款方式1-银行转账,2-微信支付,3-支付宝支付,4-现金,5-其他付款方式 验证
            'payment_method' => 'required',

        ];
    }


    /**
     * 字段映射名称
     * return array
     */
    public function attributes(): array
    {
        return [
            'id' => '结算单号',
            'settlement_status' => '结算状态：1-待结算，2-已结算',
            'settlement_date' => '结算日期',
            'payment_method' => '付款方式1-银行转账,2-微信支付,3-支付宝支付,4-现金,5-其他付款方式',

        ];
    }

public function messages(): array
{
    return [
            'id.required' => '必填结算单号',
            'settlement_status.required' => '必填结算状态：1-待结算，2-已结算',
            'settlement_date.required' => '必填结算日期',
            'payment_method.required' => '必填付款方式1-银行转账,2-微信支付,3-支付宝支付,4-现金,5-其他付款方式',

    ];
}
}